package com.zwb.service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zwb.service.mapper.RoleMapper;
import com.zwb.service.pojo.Role;
import com.zwb.service.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zwb
 * @since 2022-08-23
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;

    /**
     * 根据用户id 查询 角色
     *
     * @param id
     * @return  List<Role>
     */
    @Override
    public List<Role> getRolesByUserId(long id) {
        return roleMapper.getRolesByUserId(id);
    }
}
